<?php
namespace App\Repositories;

use App\Models\Banner;
use App\Exceptions\InvalidException;
class BannerRepo
{

    public function getBannerList()
    {
        return Banner::where('status',1)->select('id','title','url')->get();
    }

    public function editBanner($id,$data)
    {
        Banner::where('id',$id)->update($data);
    }
    public function addBanner($data)
    {
        Banner::create($data);
    }
     public function delBanner($id)
    {
        $banner = Banner::where('id',$id)->first();
        $banner->delete();
    }
}